class Solution(object):
    def middleNode(self, head):
        """
        :type head: ListNode
        :rtype: ListNode
        """
        node = head
        count = 0
        while node:
            count += 1
            node = node.next
        mid = count // 2
        node = head
        count = 0
        while count < mid:
            count += 1
            node = node.next
        return node